<%@page import="weixinkeji.dev.dc.base.scheme.promotions.cache.PromotionConfigControl"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/jspf/must/basePath.jspf" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>服务员下单</title>
        <script src="zj/jq/jquery-1.11.3.min.js"></script>

        <%@include file="/WEB-INF/jspf/zj/uikit/uikit.jspf" %>
        <%@include file="/WEB-INF/jspf/zj/uikit/sticky.jspf" %>

        <link href="zj/ligerui/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css">
        <script src="zj/ligerui/ligerUI/js/core/base.js" type="text/javascript"></script>
        <script src="zj/ligerui/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>

        <script src="dc_manager/base/scheme/combo/fl/js/combofl_treeMenu.js" type="text/javascript"></script>
        <script src="dc_view/buy/js/combobView.js" type="text/javascript"></script>

        <script type = "text/javascript">
            function detectBrowser() {
                var browser = getBrowserInfo();
                if (null != browser) {
                    var verinfo = (browser + "").replace(/[^0-9.]/ig, "");
                    if (verinfo < 10) {
                        alert("您好朋友，本网站对IE10以下的核心版本(您的版本" + verinfo + ")不兼容。为了不影响您的阅读，请换其他浏览器.");
                    }
                }
                function getBrowserInfo() {
                    var agent = navigator.userAgent.toLowerCase();
                    var regStr_ie = /msie [\d.]+;/gi;
                    if (agent.indexOf("msie") > 0) {
                        return agent.match(regStr_ie);
                    }
                    return null;
                }
            }
            $(function () {
                f_dc_base_combofl_menuTree("DivID_showMenu", f_combofl_choose);
                $.post("view/show/combo/list.imy", {}, function (data) {
                    showDate(data);
                }, "json");

                function f_combofl_choose(d, terget) {
                    $.post("view/show/combo/list.imy", {flid: getMyNodeID("flid", d.data)}, function (data) {
                        showDate(data);
                    }, "json");
                }

                function showDate(data) {
                    if (null != data) {
                        var str = "";
                        for (var i = 0; i < data.length; i++) {
                            str = str + tableTR_Date(
                                    data[i].combo_name
                                    , data[i].combo_price
                                    , data[i].combo_listPriceSum
                                    , data[i].combo_info
                                    , data[i].combo_id
                                    );
                        }
                        $("#indexSY").html(str);
                    }
                    function tableTR_Date(combo_name, combo_price, combo_listPriceSum, combo_info, id) {
                        var str = "<tr style=\"height:40px\">"
                                + "<td class=\"uk-text-middle uk-text-center\"><a href=\"#showMyComboB\" data-uk-modal onclick=\"f_showcombo('" + id + "')\">" + combo_name + "</a></td>"
                                + "<td class=\"uk-text-middle uk-text-center\">" + combo_price + "</td>"
                                + "<td class=\"uk-text-middle uk-text-center\">" + combo_listPriceSum + "</td>"
                                + "<td class=\"uk-text-middle uk-text-center\">" + combo_info + "</td>"
                                + "<td class=\"uk-text-middle\" onclick=\"addFood('" + id + "')\">"
                                + "<div class=\"uk-text-middle uk-text-center uk-button-primary\" style=\"width:100%;height:40px;float:left;\">下单</div>"
//                                + "<div class=\" uk-text-middle uk-text-center uk-button\" style=\"width:50%;height:40px;float:left;\">暂无收藏</div>"
                                + "</td>"
                                + "</tr>";
                        return str;
                    }
                }
            });

            function f_showcombo(id) {

                $.post("view/show/combo/combob.imy", {combo_id: id}, function (data) {
                    showCombobViewDate(data, "divID_showFood");
                }, "json");
            }

//            function showImg(imgsrc) {
//                $("#SHOW_IMG_ID").attr("src", imgsrc);
//            }
            function addFood(food_id) {
                $.post("weixinkeji/dev/dc/buy/order/a/add.imy", {
                    sort: 3
                    , id: food_id
                    , number: 1.0
                }, function (d) {//d.statusCode == 200
                    if (d.statusCode == 200) {
                        UIkit.notify(d.message, {timeout: 1200, status: 'success'});
                    } else {
                        UIkit.notify(d.message, {timeout: 2000, status: 'warning'});
                    }
                }, "json");
            }
        </script>

    </head>

    <body onload="detectBrowser()">
        <div class="uk-width-1" style="margin-top: 15px;margin-bottom: 40px;">
            <nav class="uk-navbar" data-uk-sticky>
                <a class="uk-navbar-brand" href="http://imyweb.org"
                   title="IMY框架是一款开源免费的高效高速小巧强大的WEB框架!如果您需要为此产品进行二次开发，您将会需要用到这IMY框架！"
                   target="_blank">IMY框架</a>
                <div class="uk-container uk-container-center">
                    <ul class="uk-navbar-nav">
                        <%                            if (PromotionConfigControl.checkOK()) {
                                out.print("<li><a href=\"dc_view/buy/fwy/xd_promotionDay.jsp\">活动</a></li>");
                            }
                        %>
                        <li><a href="dc_view/buy/fwy/xd_food.jsp">菜单</a></li>
                        <li  class="uk-active"><a href="dc_view/buy/fwy/xd_combo.jsp">套餐</a></li>
                        <li><a class="uk-button-primary" href="#showFWYCar" data-uk-modal onclick="selectKD_NOWSelect()">购物车</a></li>
                        <li><a href="dc_view/buy/fwy/kd.jsp">开单</a></li>
                    </ul>
                </div>
            </nav>
        </div>
        <div id="DivID_showMenu" style="float:left; margin-left: 15px;font-size:15px;">
        </div>
        <div class="uk-container uk-container-center">
            <div class="uk-margin uk-grid">

                <div class="uk-width-1-1">
                    <!--style="float:left"-->
                    <div>
                        <table class="uk-table uk-table-hover">
                            <thead  style="text-align: center">
                                <tr>
                                    <!--<th class="uk-text-center">归类</th>-->
                                    <th class="uk-text-center">名称</th>
                                    <th class="uk-text-center">套装价格</th>
                                    <th class="uk-text-center">散购总值</th>
                                    <th class="uk-text-center">说明</th>
                                    <!--                                    <th class="uk-text-center">现购买(元)</th>-->
                                    <th class="uk-text-center">下单操作</th>
                                </tr>
                            </thead>
                            <tbody id="indexSY">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <!-- 模态对话框 -->
        <div id="showMyComboB" class="uk-modal">
            <div class="uk-modal-dialog">
                <a href="" class="uk-modal-close uk-close uk-close-alt"></a>
                <div class="uk-overflow-container">
                    <table class="uk-table uk-table-hover">
                        <thead  style="text-align: center">
                            <tr>
                                <th width="55px" class="uk-text-center">预览</th>
                                <th class="uk-text-center">归类</th>
                                <th class="uk-text-center">菜名(单位)</th>
                                <th class="uk-text-center">数量</th>
                                <th class="uk-text-center">价格(元)</th>
                            </tr>
                        </thead>
                        <tbody id="divID_showFood">
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <%@include file="/WEB-INF/jspf/dc/fwy/fwyCar.jspf" %>
    </body>
</html>
